package com.example.springboot.service;

import com.example.springboot.common.Page;
import com.example.springboot.common.Result;
import com.example.springboot.dto.*;
import com.example.springboot.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;

public interface IUserService extends IService<User> {

    UserSolutionDTO getUserSolutionDTO(Integer id,Integer solutionId);
    UserDTO getUserDTO(Integer id);
    UserHomeDTO getHome(Integer id);
    HashMap<String, List<CmntCenterDTO>> getCommentsCenter(Integer id);
    Result findPage(int pageNum, int pageSize, String username, String nickname);
    Result loginByCode(String email, String code, HttpServletRequest request);
    String updateAvatar(String url);
    Page getAvatars(int PageNum, int PageSize);
    User getByToken(String token);
    Result register(LoginDTO loginDTO, HttpServletRequest request) throws IOException;
    Result loginByPassword(String email, String password);
    Result firstLoginFromPlatform(String email, String username, String code,HttpServletRequest request) throws IOException;
    Result loginFromPlatform(String email, String username);
    Result setPassword(String email, String code, String password, HttpServletRequest request);
    Result publishAvatar(Integer id, String url);
    Result unPublishAvatar(Integer id, String url);
}
